<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page
	import="org.springframework.web.context.support.WebApplicationContextUtils"%>
<%@ page import="org.springframework.context.ApplicationContext"%>

<%@page import="cn.hn.tx.uchblog.service.*"%>
<%@page import="cn.hn.tx.uchblog.model.*"%>
<%@page import="cn.hn.comm.*"%>
<%@page import="cn.hn.tx.rebot.task.job.*"%>
<%@page import="com.eic.core.spring.BeanFactoryUtil"%>
<%@page import="cn.hn.tx.rebot.task.app.JobFromDBTask"%>

<%@page import="cn.hn.tx.rebot.blog.service.IRebotBlogService"%>
<%@page import="cn.hn.tx.rebot.blog.model.Blog"%>
<%@page import="cn.hn.tx.rebot.task.job.TaskJob_CrawlBlog"%>
<%@page import="cn.hn.comm.Tools"%>
<%@page import="cn.hn.tx.uchblog.service.IUchomeBlogService"%>
<%@page import="cn.hn.tx.rebot.task.service.ITaskService"%>
<%@page import="cn.hn.tx.rebot.task.model.TaskExeLog"%>
<%@page import="cn.hn.tx.rebot.task.model.TaskExeLog"%>
<%@page import="cn.hn.comm.exception.IExceptionService"%>



<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">

		<title>My JSP 'index.jsp' starting page</title>
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	</head>

	<body>
		This is my JSP page.
		<br>
		<%
    Object obj=getServletContext();
    //System.out.println(obj);
    ApplicationContext  context  =  WebApplicationContextUtils.getWebApplicationContext(getServletContext());

	/*
	IUchomeBlogService ubs=(IUchomeBlogService)context.getBean("uchomeBlogService");
	UchomeBlog uchomeBlog=  ubs.queryUchomeBlogByBid(1);
	uchomeBlog.setReplynum(1);
	ubs.updateUchomeBlog(uchomeBlog);
	*/


	/*
	
	TaskJob_PublishBlog tp=(TaskJob_PublishBlog)context.getBean("TaskJob_PublishBlog");
	tp.startJob();	
	
	TaskJob_CrawlBlog tc=(TaskJob_CrawlBlog)context.getBean("TaskJob_CrawBlog_SinaEladies");
	System.out.println(tc.type().getType());
	*/

	/*
	IExceptionService exceptionService=(IExceptionService)context.getBean("exceptionService");
	
	exceptionService.insertException("className","method","异常");
	*/
	
	/*
	ITaskService taskService=(ITaskService)context.getBean("taskService");
	TaskExeLog taskExeLog=new TaskExeLog();
	taskExeLog.setEndTime(new Date());
	taskExeLog.setMemo("没什么");
	taskExeLog.setStartTime(new Date());
	taskExeLog.setTaskName("测试任务日志");
	taskExeLog.setType(0);
	taskService.insertTaskExeLog(taskExeLog);
	*/
	
    
 	/**
	IRebotBlogService rebotBlogService = (IRebotBlogService) context
					.getBean("RebotBlogService");
 	IUchomeService uchomeService=(IUchomeService)context.getBean("uchomeService");
    Blog blog =new Blog();
    blog.setTitle("<a href=\"forumdisplay.php?fid=25&amp;filter=type&amp;typeid=5\">[原创]</a> 蜜汁叉烧的转正两周年报告<a href=\"forumdisplay.php?fid=25&amp;filter=type&amp;typeid=5\">[原创]</a>");
    blog.setContent("<a href=\"forumdisplay.php?fid=25&amp;filter=type&amp;typeid=5\">[原创]</a> 蜜汁小三的转正两周年小三报告<a href=\"forumdisplay.php?fid=25&amp;filter=type&amp;typeid=5\">[原创]</a>");
	blog.setUrl("http://www.tianxin007.com");						
							blog.setTitle(Tools.
							addHrefToKeyword(Tools.replaceAllHref(blog.getTitle(),"http://www.tianxin007.com"),"小三","http://www.tianxin007.com"));
							blog.setContent(Tools.
							addHrefToKeyword(Tools.replaceAllHref(blog.getContent(),"http://www.tianxin007.com"),"小三","http://www.tianxin007.com"));
							//日志写入
							rebotBlogService.insertRebotWriteBlog(blog
									.getTitle(), blog.getContent(), blog
									.getUrl(), 0, new Date(), null, 0);
	*/
    
    
    /*
    JobFromDBTask jft=(JobFromDBTask)context.getBean("JobFormDBTask");
    
    jft.checkTask();
    */
    //jft.checkTaskTest();
    
    
	
	
	/*
    ITaskJob taskJob = (ITaskJob)context.getBean("TaskJob_PublishBlog");
    
    System.out.println(taskJob);
    taskJob.startJob();
    */
    
    /**
    ITaskJob taskJob2 = (ITaskJob)  BeanFactoryUtil.getBean("TaskJob_CrawBlog_SinaEladies");
							
	System.out.println(taskJob2);
							
		taskJob.startJob();
	System.out.println(taskJob.toString());    		
	*/
	
	/**
    IUchomeService us=(IUchomeService)context.getBean("uchomeService");
    UchomeBlog uchomeBlog=new UchomeBlog();
    uchomeBlog.setBlogid(119);
    uchomeBlog.setClassid(119);
    uchomeBlog.setClick_1(1);
    uchomeBlog.setClick_2(2);
    uchomeBlog.setClick_3(3);
    uchomeBlog.setClick_4(4);
    uchomeBlog.setClick_5(5);
    uchomeBlog.setDateline(119119);
    uchomeBlog.setFriend(123);
    uchomeBlog.setHot(5);
    uchomeBlog.setNoreply(3);
    uchomeBlog.setPassword("password");
    uchomeBlog.setPic("pic");
    uchomeBlog.setPicflag(119);
    uchomeBlog.setReplynum(1);
    uchomeBlog.setSubject("subject");
    uchomeBlog.setTopicid(1);
    uchomeBlog.setUid(1);
    uchomeBlog.setUsername("admin");
    uchomeBlog.setViewnum(33);
    
    UchomeBlogField ubf=new UchomeBlogField();
    //ubf.setBlogid(2);
    ubf.setHotuser("admin");
    ubf.setMagiccall(1);
    ubf.setMagiccolor(2);
    ubf.setMagicpaper(3);
    ubf.setMessage("message");
    ubf.setPostip("127.0.0.1");
    ubf.setRelated("related");
    ubf.setRelatedtime(123456);
    ubf.setTag("tag");
    ubf.setTarget_ids("tag_ids");
    ubf.setUid(1);
    
    us.publishUchomeBlog(uchomeBlog,ubf);
    */
    //us.insertUchomeBlogAndField(uchomeBlog,ubf);
	
	
    
    //us.insertUchomeBlogField(ubf);
    
    //Object object =us.insertUchomeBlog(uchomeBlog);
    				
    
    //ICrawlService ics=(ICrawlService)context.getBean("CrawlService");
    //ics.testDAO();
    //IRemoteService rs=(IRemoteService)context.getBean("remoteService");
    //rs.getTerminalDebugResult(null,null,null);
    

    
    
     %>
	</body>
</html>
